import { getEchoTextByValue } from '@/utils/getUtils';
export const FORM_ITEMS = [
  {
    prop: 'skuNo',
    label: 'SKU编号',
    type: 'input',
  },
  {
    prop: 'productName',
    label: '商品名称',
    type: 'input',
  },
]
export const TABLE_COLUMNS = [
  {
    title: 'SPU编码',
    key: 'spuNo',
    fixed: 'left'
  },
  {
    title: 'SKU编码',
    key: 'skuNo',
  },
  {
    title: '商品名称',
    key: 'productName',
  },
  {
    title: '规格',
    key: 'specDetail',
  },
  {
    title: '主计量名称/单位小数位',
    render: (h, { row }) => {
      if (!row.unitName) return <span></span>
      return <span>{`${row.unitName}/${row.unitDecimals}`}</span>
    }
  },
  {
    title: '辅计量名称/单位小数位',
    render: (h, { row }) => {
      if (!row.assistUnitName) return <span></span>
      return <span>{`${row.assistUnitName}/${row.unitDecimals}`}</span>
    }
  },
  {
    title: '是否只有主单位',
    render: (h, { row }) => {
      return <span>{getEchoTextByValue({ val: row.isMainUnit })}</span>
    }
  },
  {
    title: '理论转换率',
    key: 'theoryConvertRatio',
  },
  {
    title: '实际转换率',
    key: 'actualConvertRatio',
  },
  {
    title: '主辅关系',
    key: 'mainRelateAssist',
  },
  {
    title: '关系说明',
    key: 'note',
  },
  {
    title: '应用范围',
    render: (h, { row }) => {
      return <span>{getEchoTextByValue({ val: row.applyScope, firstText: '采购', secondText: '销售' })}</span>
    }
  },
  {
    title: '创建时间',
    key: 'createOpeTime',
  }
]
